<?php include "../public/header.php";?>
<?php include "../public/header_edit.php";?>

<body id="optPage">
<form class="layui-form layui-form-pane" id="commentForm">
    <div class="page-title"><div class="page-title-con"><span id="flowsetname"></span><div class="move_title"></div><?php include "../public/subturn.php";?></div></div>
    <div class="main-container">

        <div class="block-generic">
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md6">
                        <label class="layui-form-label">申请人</label>
                        <div class="layui-input-block">
                            <input type="text" id="flowuser" readonly placeholder="请输入" autocomplete="off" class="layui-input readonly">
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <label class="layui-form-label">申请部门</label>
                        <div class="layui-input-block">
                            <input type="text" id="flowdept" readonly placeholder="请输入" autocomplete="off" class="layui-input readonly">
                        </div>
                    </div>
                </div>
            </div>


            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="edittits"><span>基本信息</span></div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md6">
                        <label class="layui-form-label"><text>*</text>工资月份</label>
                        <div class="layui-input-block">
                            <input type="text" name="month" id="month" readonly placeholder="请选择" clearable  autocomplete="off" class="layui-input bdate_ymaaaa">
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <label class="layui-form-label"><text>*</text>工资标题</label>
                        <div class="layui-input-block">
                            <input type="text" name="title" id="title" placeholder="请输入" clearable autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md6">
                        <label class="layui-form-label"><text>*</text>实发工资合计(元)</label>
                        <div class="layui-input-block">
                            <input type="text" name="money" id="money" readonly  placeholder="请输入" autocomplete="off" class="layui-input moneyinput disabled">
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <label class="layui-form-label">计划发放日期</label>
                        <div class="layui-input-block">
                            <input type="text" name="jidt" id="jidt" readonly placeholder="请选择" clearable  autocomplete="off" class="layui-input bdate_ymd">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item height_auto">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label label_textarea">备注</label>
                        <div class="layui-input-block">
                            <textarea id="explain" name="explain" placeholder="请输入" class="layui-textarea"></textarea>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label">关联流程</label>
                        <div class="layui-input-block">
                            <input type="text" readonly name="flowrelas" class="layui-input flowrelas" onclick="openPage('../public/choose_flowrelas.php?dom=flowrelas','80%','80%');">
                            <div class="choose_div" id="flowrelas" key="1"></div>
                            <span class="choose_one" onclick="openPage('../public/choose_flowrelas.php?dom=flowrelas','80%','80%');"><i class="layui-icon layui-icon-search"></i></span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item layui-hide" id="advanersDiv">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label">预审人</label>
                        <div class="layui-input-block relative">
                            <div class="tanxian">
                                <div class="tanxianclick" onclick="openPage('../public/choose_userpart.php?dom=advaners&type=user&single=2','770px','490px');"></div>
                                <div class="tanxiannei" id="advaners"></div>
                            </div>
                            <div class="tancheckdiv"><div class="tancheck" onclick="openPage('../public/choose_userpart.php?dom=advaners&type=user&single=2','770px','490px');"><i class="layui-icon layui-icon-search"></i></div></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item layui-hide" id="nexterDiv">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label"><text>*</text>指定下一步审核人</label>
                        <div class="layui-input-block relative">
                            <div class="tanxian">
                                <div class="tanxianclick" onclick="openPage('../public/choose_userpart.php?dom=nexter&type=user&single=1','770px','490px');"></div>
                                <div class="tanxiannei" id="nexter"></div>
                            </div>
                            <div class="tancheckdiv"><div class="tancheck" onclick="openPage('../public/choose_userpart.php?dom=nexter&type=user&single=1','770px','490px');"><i class="layui-icon layui-icon-search"></i></div></div>
                        </div>
                    </div>
                </div>
            </div>
            <?php include '../public/upinfo.php'?>
        </div>


        <div class="block-generic">
            <div class="layui-form-item height_auto">
                <div class="short_table_list" key="1">
                    <div class="opt-btn-group">
                        <div><span>工资明细</span></div>
                        <div>
                            <button type="button" onclick="ctrlv_data_open()" class="layui-btn layui-btn-sm layui-btn-primary mingxibtn">粘贴新增</button>
                            <button type="button" onclick="import_list()" class="layui-btn layui-btn-sm layui-btn-primary mingxibtn">Excel导入</button>
                            <button type="button" class="layui-btn layui-btn-sm layui-btn-primary mingxibtn short_table_copy_row">复制行</button>
                            <button type="button" class="layui-btn layui-btn-sm layui-btn-primary mingxibtn short_table_add_row">插入行</button>
                            <button type="button" class="layui-btn layui-btn-sm layui-btn-primary mingxibtn short_table_del_row">删除行</button>
                            <button type="button" class="layui-btn layui-btn-sm layui-btn-primary mingxibtn short_table_del_all">删除全部</button>
                        </div>
                    </div>
                    <div style="overflow: auto">
                        <div style="width: 2500px;overflow: hidden">
                            <table class="layui-table" lay-size="sm">
                                <thead>
                                <tr>
                                    <th width="45">序号</th>
                                    <th><text>*</text>姓名</th>
                                    <th>部门</th>
                                    <th>岗位</th>
                                    <th>状态</th>
                                    <th>入职时间</th>
                                    <th>应出勤天数</th>
                                    <th><text>*</text>实际出勤天数</th>
                                    <th>出勤率</th>
                                    <th>司龄</th>
                                    <th><text>*</text>基本工资</th>
                                    <th><text>*</text>岗位绩效</th>
                                    <th><text>*</text>管理绩效</th>
                                    <th><text>*</text>薪资标准实发</th>
                                    <th><text>*</text>司龄补贴</th>
                                    <th><text>*</text>住房补贴</th>
                                    <th><text>*</text>学历补贴</th>
                                    <th><text>*</text>人员证书补贴</th>
                                    <th><text>*</text>餐费补贴</th>
                                    <th><text>*</text>法定代表人补贴</th>
                                    <th><text>*</text>全勤补贴</th>
                                    <th><text>*</text>奖金</th>
                                    <th><text>*</text>应发小计</th>
                                    <th><text>*</text>漏签</th>
                                    <th><text>*</text>迟到</th>
                                    <th><text>*</text>旷工</th>
                                    <th><text>*</text>其他</th>
                                    <th><text>*</text>扣除小计</th>
                                    <th><text>*</text>养老</th>
                                    <th><text>*</text>医疗</th>
                                    <th><text>*</text>失业</th>
                                    <th><text>*</text>个税</th>
                                    <th>专项扣除小计</th>
                                    <th>个人工资合计</th>
                                    <th>赡养补贴</th>
                                    <th>抚养补贴</th>
                                    <th>教育补贴</th>
                                    <th><text>*</text>实发工资合计</th>
                                    <th>备注</th>
                                </tr>
                                </thead>
                                <tbody class="short_table_tbody" id="list_list"></tbody>
                            </table>

                        </div>
                    </div>
                    <div class="listerror">提示：<span></span></div>
                </div>
            </div>
        </div>


    </div>
</form>
<script>
    $("#commentForm").validate({
        rules: {
            month: {required: true},
            title: {required: true},
        },
        messages:{
            month: {required: "请选择"},
            title: {required: "请输入"},
        }
    });



    function import_list() {
        openPage('../public/import.php?reveal=wagyuan@importdata', '770px', '490px');
    }

    layui.use(['laytp', 'form'], function() {
        var form = layui.form, layer = layui.layer;
        render_input_attr();

        $('.bdate_ymaaaa').datetimepicker({
            language: 'zh-CN',//显示中文
            format: 'yyyy-mm',//显示格式
            startView: '3',
            minView: "3",//设置只显示到月份
            initialDate: new Date(),//初始化当前日期
            autoclose: true,//选中自动关闭
            todayBtn: true//显示今日按钮
        }).on('changeDate',function (ddd) {
            var month = $("#month").val() || '';
            facade.ajax({url: ask_get_wagyuanback_by_month_list,data:{month:month}}).done(function(res){
                if (res.code === 2000) {
                    var list = res.data.list;

                    var str = '';
                    for (var key in list){
                        var nums = parseInt(key)+1;
                        str += '<tr>';
                        str += '<td style="width: 45px">'+nums+'</td>';
                        str += '<td><input type="text" class="layui-input name" value="'+list[key].name+'"></td>';
                        str += '<td><input type="text" class="layui-input deptname" value="'+list[key].deptname+'"></td>';
                        str += '<td><input type="text" class="layui-input gangname" value="'+list[key].gangname+'"></td>';
                        str += '<td><input type="text" class="layui-input zhuang" value="'+list[key].zhuang+'"></td>';
                        str += '<td><input type="text" class="layui-input rudt" value="'+list[key].rudt+'"></td>';
                        str += '<td><input type="number" class="layui-input yingday" value="'+list[key].yingday+'"></td>';
                        str += '<td><input type="number" class="layui-input shiday" value="'+list[key].shiday+'"></td>';
                        str += '<td><input type="number" class="layui-input dayrate" value="'+list[key].dayrate+'"></td>';
                        str += '<td><input type="number" class="layui-input siage" value="'+list[key].siage+'"></td>';
                        str += '<td><input type="number" class="layui-input jibenshi" value="'+list[key].jibenshi+'"></td>';
                        str += '<td><input type="number" class="layui-input gangshi" value="'+list[key].gangshi+'"></td>';
                        str += '<td><input type="number" class="layui-input guanshi" value="'+list[key].guanshi+'"></td>';
                        str += '<td><input type="number" class="layui-input xinshi" value="'+list[key].xinshi+'"></td>';
                        str += '<td><input type="number" class="layui-input sibushi" value="'+list[key].sibushi+'"></td>';
                        str += '<td><input type="number" class="layui-input zhushi" value="'+list[key].zhushi+'"></td>';
                        str += '<td><input type="number" class="layui-input xueshi" value="'+list[key].xueshi+'"></td>';
                        str += '<td><input type="number" class="layui-input renbu" value="'+list[key].renbu+'"></td>';
                        str += '<td><input type="number" class="layui-input canshi" value="'+list[key].canshi+'"></td>';
                        str += '<td><input type="number" class="layui-input fabu" value="'+list[key].fabu+'"></td>';
                        str += '<td><input type="number" class="layui-input quanbu" value="'+list[key].quanbu+'"></td>';
                        str += '<td><input type="number" class="layui-input jiang" value="'+list[key].jiang+'"></td>';
                        str += '<td><input type="number" class="layui-input yingfee" value="'+list[key].yingfee+'"></td>';
                        str += '<td><input type="number" class="layui-input lou" value="'+list[key].lou+'"></td>';
                        str += '<td><input type="number" class="layui-input chi" value="'+list[key].chi+'"></td>';
                        str += '<td><input type="number" class="layui-input kuang" value="'+list[key].kuang+'"></td>';
                        str += '<td><input type="number" class="layui-input qikou" value="'+list[key].qikou+'"></td>';
                        str += '<td><input type="number" class="layui-input koufee" value="'+list[key].koufee+'"></td>';
                        str += '<td><input type="number" class="layui-input yang" value="'+list[key].yang+'"></td>';
                        str += '<td><input type="number" class="layui-input liao" value="'+list[key].liao+'"></td>';
                        str += '<td><input type="number" class="layui-input shi" value="'+list[key].shi+'"></td>';
                        str += '<td><input type="number" class="layui-input geshui" value="'+list[key].geshui+'"></td>';
                        str += '<td><input type="number" class="layui-input zhuankou" value="'+list[key].zhuankou+'"></td>';
                        str += '<td><input type="number" class="layui-input gekou" value="'+list[key].gekou+'"></td>';
                        str += '<td><input type="number" class="layui-input shanbu" value="'+list[key].shanbu+'"></td>';
                        str += '<td><input type="number" class="layui-input yangbu" value="'+list[key].yangbu+'"></td>';
                        str += '<td><input type="number" class="layui-input jiaobu" value="'+list[key].jiaobu+'"></td>';
                        str += '<td><input type="number" class="layui-input money" value="'+list[key].money+'"></td>';
                        str += '<td><input type="text" class="layui-input explain" value="'+list[key].explain+'"></td>';
                        str += '</tr>';
                    }
                    $("#list_list").html(str);

                    update_refresh_row_func();
                    render_from();
                }
            });
        });


        facade.ajax({type: 'get', url: ask_flowdata_add_wagyuan}).done(function(res){
            if (res.code === 2000) {
                var data = res.data;
                $("#flowsetname").text(data.flowsetname);
                $("#flowuser").val(data.flowuser);
                $("#flowdept").val(data.flowdept);
                if(data.isadvan){
                    $("#advanersDiv").removeClass('layui-hide');
                }
                if(data.isnext){
                    $("#nexterDiv").removeClass('layui-hide');
                }

                var listAddStr = '';
                listAddStr += '<tr>';
                listAddStr += '<td style="width: 45px">1</td>';
                listAddStr += '<td><input type="text" class="layui-input name"></td>';
                listAddStr += '<td><input type="text" class="layui-input deptname"></td>';
                listAddStr += '<td><input type="text" class="layui-input gangname"></td>';
                listAddStr += '<td><input type="text" class="layui-input zhuang"></td>';
                listAddStr += '<td><input type="text" class="layui-input rudt"></td>';
                listAddStr += '<td><input type="number" class="layui-input yingday"></td>';
                listAddStr += '<td><input type="number" class="layui-input shiday"></td>';
                listAddStr += '<td><input type="number" class="layui-input dayrate"></td>';
                listAddStr += '<td><input type="number" class="layui-input siage"></td>';
                listAddStr += '<td><input type="number" class="layui-input jibenshi"></td>';
                listAddStr += '<td><input type="number" class="layui-input gangshi"></td>';
                listAddStr += '<td><input type="number" class="layui-input guanshi"></td>';
                listAddStr += '<td><input type="number" class="layui-input xinshi"></td>';
                listAddStr += '<td><input type="number" class="layui-input sibushi"></td>';
                listAddStr += '<td><input type="number" class="layui-input zhushi"></td>';
                listAddStr += '<td><input type="number" class="layui-input xueshi"></td>';
                listAddStr += '<td><input type="number" class="layui-input renbu"></td>';
                listAddStr += '<td><input type="number" class="layui-input canshi"></td>';
                listAddStr += '<td><input type="number" class="layui-input fabu"></td>';
                listAddStr += '<td><input type="number" class="layui-input quanbu"></td>';
                listAddStr += '<td><input type="number" class="layui-input jiang"></td>';
                listAddStr += '<td><input type="number" class="layui-input yingfee"></td>';
                listAddStr += '<td><input type="number" class="layui-input lou"></td>';
                listAddStr += '<td><input type="number" class="layui-input chi"></td>';
                listAddStr += '<td><input type="number" class="layui-input kuang"></td>';
                listAddStr += '<td><input type="number" class="layui-input qikou"></td>';
                listAddStr += '<td><input type="number" class="layui-input koufee"></td>';
                listAddStr += '<td><input type="number" class="layui-input yang"></td>';
                listAddStr += '<td><input type="number" class="layui-input liao"></td>';
                listAddStr += '<td><input type="number" class="layui-input shi"></td>';
                listAddStr += '<td><input type="number" class="layui-input geshui"></td>';
                listAddStr += '<td><input type="number" class="layui-input zhuankou"></td>';
                listAddStr += '<td><input type="number" class="layui-input gekou"></td>';
                listAddStr += '<td><input type="number" class="layui-input shanbu"></td>';
                listAddStr += '<td><input type="number" class="layui-input yangbu"></td>';
                listAddStr += '<td><input type="number" class="layui-input jiaobu"></td>';
                listAddStr += '<td><input type="number" class="layui-input money"></td>';
                listAddStr += '<td><input type="text" class="layui-input explain"></td>';
                listAddStr += '</tr>';
                short_table_opt_func(listAddStr, 1);


                update_refresh_row_func();


                public_upload_file_load('upload_files', res.data.files);
                initParseMoney();
                render_from();
            }
        });



        form.on('submit(add)', function(data){
            data.field.isturn = $(this).attr('key') || 0;
            data.field.flowrelas = get_choose_val('flowrelas');
            data.field.advaners = tan_tags_getvalue("#advaners", 'user');
            data.field.nexter = tan_tags_getvalue("#nexter", 'user');
            if(data.field.isturn > 0){
                var validRes = $("#commentForm").valid();
                if(!validRes){return false;}
            }



            var list = [''];
            try {
                $('#list_list tr').each(function (i) {
                    var name = $(this).find('.name').val();
                    var deptname = $(this).find('.deptname').val();
                    var gangname = $(this).find('.gangname').val();
                    var zhuang = $(this).find('.zhuang').val();
                    var rudt = $(this).find('.rudt').val();
                    var yingday = $(this).find('.yingday').val();
                    var shiday = $(this).find('.shiday').val();
                    var dayrate = $(this).find('.dayrate').val();
                    var siage = $(this).find('.siage').val();
                    var jibenshi = $(this).find('.jibenshi').val();
                    var gangshi = $(this).find('.gangshi').val();
                    var guanshi = $(this).find('.guanshi').val();
                    var xinshi = $(this).find('.xinshi').val();
                    var sibushi = $(this).find('.sibushi').val();
                    var zhushi = $(this).find('.zhushi').val();
                    var xueshi = $(this).find('.xueshi').val();
                    var renbu = $(this).find('.renbu').val();
                    var canshi = $(this).find('.canshi').val();
                    var fabu = $(this).find('.fabu').val();
                    var quanbu = $(this).find('.quanbu').val();
                    var jiang = $(this).find('.jiang').val();
                    var yingfee = $(this).find('.yingfee').val();
                    var lou = $(this).find('.lou').val();
                    var chi = $(this).find('.chi').val();
                    var kuang = $(this).find('.kuang').val();
                    var qikou = $(this).find('.qikou').val();
                    var koufee = $(this).find('.koufee').val();
                    var yang = $(this).find('.yang').val();
                    var liao = $(this).find('.liao').val();
                    var shi = $(this).find('.shi').val();
                    var geshui = $(this).find('.geshui').val();
                    var zhuankou = $(this).find('.zhuankou').val();
                    var gekou = $(this).find('.gekou').val();
                    var shanbu = $(this).find('.shanbu').val();
                    var yangbu = $(this).find('.yangbu').val();
                    var jiaobu = $(this).find('.jiaobu').val();
                    var money = $(this).find('.money').val();
                    var explain = $(this).find('.explain').val();


                    var index = i + 1;
                    if(data.field.isturn > 0){
                        if(!name){
                            throw new Error('第'+index+'行，请输入姓名');
                        }
                        if(!shiday){
                            throw new Error('第'+index+'行，请输入实际出勤天数');
                        }
                        if(!jibenshi){
                            throw new Error('第'+index+'行，请输入基本工资');
                        }
                        if(!gangshi){
                            throw new Error('第'+index+'行，请输入岗位绩效');
                        }
                        if(!guanshi){
                            throw new Error('第'+index+'行，请输入管理绩效');
                        }
                        if(!xinshi){
                            throw new Error('第'+index+'行，请输入薪资标准实发');
                        }
                        if(!sibushi){
                            throw new Error('第'+index+'行，请输入司龄补贴');
                        }
                        if(!zhushi){
                            throw new Error('第'+index+'行，请输入住房补贴');
                        }
                        if(!xueshi){
                            throw new Error('第'+index+'行，请输入学历补贴');
                        }
                        if(!renbu){
                            throw new Error('第'+index+'行，请输入人员证书补贴');
                        }
                        if(!canshi){
                            throw new Error('第'+index+'行，请输入餐费补贴');
                        }
                        if(!fabu){
                            throw new Error('第'+index+'行，请输入法定代表人补贴');
                        }
                        if(!quanbu){
                            throw new Error('第'+index+'行，请输入全勤补贴');
                        }
                        if(!jiang){
                            throw new Error('第'+index+'行，请输入奖金');
                        }
                        if(!yingfee){
                            throw new Error('第'+index+'行，请输入应发小计');
                        }
                        if(!lou){
                            throw new Error('第'+index+'行，请输入漏签(扣)');
                        }
                        if(!chi){
                            throw new Error('第'+index+'行，请输入迟到(扣)');
                        }
                        if(!kuang){
                            throw new Error('第'+index+'行，请输入旷工(扣)');
                        }
                        if(!qikou){
                            throw new Error('第'+index+'行，请输入其他(扣)');
                        }
                        if(!koufee){
                            throw new Error('第'+index+'行，请输入小计(扣)');
                        }
                        if(!yang){
                            throw new Error('第'+index+'行，请输入养老(扣)');
                        }
                        if(!liao){
                            throw new Error('第'+index+'行，请输入医疗(扣)');
                        }
                        if(!shi){
                            throw new Error('第'+index+'行，请输入失业(扣)');
                        }
                        if(!geshui){
                            throw new Error('第'+index+'行，请输入个税(扣)');
                        }
                        if(!money){
                            throw new Error('第'+index+'行，请输入实发工资合计');
                        }
                    }



                    list.push({
                        name:name,
                        deptname:deptname,
                        gangname:gangname,
                        zhuang:zhuang,
                        rudt:rudt,
                        yingday:yingday,
                        shiday:shiday,
                        dayrate:dayrate,
                        siage:siage,
                        jibenshi:jibenshi,
                        gangshi:gangshi,
                        guanshi:guanshi,
                        xinshi:xinshi,

                        sibushi:sibushi,
                        zhushi:zhushi,
                        xueshi:xueshi,
                        renbu:renbu,
                        canshi:canshi,
                        fabu:fabu,
                        quanbu:quanbu,
                        jiang:jiang,
                        yingfee:yingfee,
                        lou:lou,
                        chi:chi,
                        kuang:kuang,
                        qikou:qikou,
                        koufee:koufee,
                        yang:yang,
                        liao:liao,
                        shi:shi,
                        geshui:geshui,
                        zhuankou:zhuankou,
                        gekou:gekou,
                        shanbu:shanbu,
                        yangbu:yangbu,
                        jiaobu:jiaobu,
                        money:money,
                        explain:explain,
                    });
                });
            } catch(e) {
                $(".listerror").find('span').text(e.message);
                $(".listerror").show();
                return false;
            }
            $(".listerror").hide();
            data.field.list = list;

            data = parseMoney(data);

            data.field.files = public_upload_file_value('upload_files');
            public_flow_submit(data.field, ask_flowdata_add_wagyuan, ask_flowdata_edit_wagyuan, $(this).attr('but'));

            return false;
        });

    });



    $('#list_list').on('input propertychange','.money',function () {
        jisuan_money_all();
    });
    function jisuan_money_all() {
        var allmoney = 0;
        $('#list_list tr').each(function (i) {
            var money = parseValidNum($(this).find('.money').val());
            allmoney = parseFloat(allmoney) + parseFloat(money);
        });
        $("#money").val(allmoney);
        initParseMoney();
    }

    function update_refresh_row_func() {
        render_date();
        render_from();
        jisuan_money_all();

        $.each($("#list_list").children('tr'),function (key,val) {
            $(this).children('td:first-child').html(key+1);
        });
        setTimeout(function () {
            $(".short_table_list table tbody tr").click(function () {
                $(".short_table_list table tbody tr").removeClass('line-row');
                $(".short_table_list table tbody tr").attr('sle','');
                $(this).addClass('line-row');
                $(this).attr('sle','sle');
            });
        },1000);
    }




    var ctrlv_field_name = [
        {field: 'name', name:'姓名'},
        {field: 'deptname', name:'部门'},
        {field: 'gangname', name:'岗位'},
        {field: 'zhuang', name:'状态'},
        {field: 'rudt', name:'入职时间'},
        {field: 'yingday', name:'应出勤天数',type:'number'},
        {field: 'shiday', name:'实际出勤天数',type:'number'},
        {field: 'dayrate', name:'出勤率',type:'number'},
        {field: 'siage', name:'司龄'},
        {field: 'jibenshi', name:'基本工资',type:'number'},
        {field: 'gangshi', name:'岗位绩效',type:'number'},
        {field: 'guanshi', name:'管理绩效',type:'number'},
        {field: 'xinshi', name:'薪资标准实发',type:'number'},

        {field: 'sibushi', name:'司龄补贴',type:'number'},
        {field: 'zhushi', name:'住房补贴',type:'number'},
        {field: 'xueshi', name:'学历补贴',type:'number'},
        {field: 'renbu', name:'人员证书补贴',type:'number'},
        {field: 'canshi', name:'餐费补贴',type:'number'},
        {field: 'fabu', name:'法定代表人补贴',type:'number'},
        {field: 'quanbu', name:'全勤补贴',type:'number'},
        {field: 'jiang', name:'奖金',type:'number'},
        {field: 'yingfee', name:'应发小计',type:'number'},
        {field: 'lou', name:'漏签',type:'number'},
        {field: 'chi', name:'迟到',type:'number'},
        {field: 'kuang', name:'旷工',type:'number'},
        {field: 'qikou', name:'其他',type:'number'},
        {field: 'koufee', name:'扣除小计',type:'number'},
        {field: 'yang', name:'养老',type:'number'},
        {field: 'liao', name:'医疗',type:'number'},
        {field: 'shi', name:'失业',type:'number'},
        {field: 'geshui', name:'个税',type:'number'},
        {field: 'zhuankou', name:'专项扣除小计',type:'number'},
        {field: 'gekou', name:'个人工资合计',type:'number'},
        {field: 'shanbu', name:'赡养补贴',type:'number'},
        {field: 'yangbu', name:'抚养补贴',type:'number'},
        {field: 'jiaobu', name:'教育补贴',type:'number'},
        {field: 'money', name:'实发工资合计',type:'number'},
        {field: 'explain', name:'备注'},
    ];
    function ctrlv_data_show(list) {
        if(list.length > 0){
            var nums = $("#list_list tr").length;
            for (var key in list){
                var str = '';
                nums++;

                for (var mmm in ctrlv_field_name) {
                    if(ctrlv_field_name[mmm].type && ctrlv_field_name[mmm].type == 'number'){
                        if(!list[key][ctrlv_field_name[mmm].field]){
                            list[key][ctrlv_field_name[mmm].field] = 0;
                        }
                    }
                }



                str += '<tr>';
                str += '<td style="width: 45px">'+nums+'</td>';
                str += '<td><input type="text" class="layui-input name" value="'+list[key].name+'"></td>';
                str += '<td><input type="text" class="layui-input deptname" value="'+list[key].deptname+'"></td>';
                str += '<td><input type="text" class="layui-input gangname" value="'+list[key].gangname+'"></td>';
                str += '<td><input type="text" class="layui-input zhuang" value="'+list[key].zhuang+'"></td>';
                str += '<td><input type="text" class="layui-input rudt" value="'+list[key].rudt+'"></td>';
                str += '<td><input type="number" class="layui-input yingday" value="'+list[key].yingday+'"></td>';
                str += '<td><input type="number" class="layui-input shiday" value="'+list[key].shiday+'"></td>';
                str += '<td><input type="number" class="layui-input dayrate" value="'+list[key].dayrate+'"></td>';
                str += '<td><input type="text" class="layui-input siage" value="'+list[key].siage+'"></td>';

                str += '<td><input type="number" class="layui-input jibenshi" value="'+list[key].jibenshi+'"></td>';
                str += '<td><input type="number" class="layui-input gangshi" value="'+list[key].gangshi+'"></td>';
                str += '<td><input type="number" class="layui-input guanshi" value="'+list[key].guanshi+'"></td>';
                str += '<td><input type="number" class="layui-input xinshi" value="'+list[key].xinshi+'"></td>';

                str += '<td><input type="number" class="layui-input sibushi" value="'+list[key].sibushi+'"></td>';
                str += '<td><input type="number" class="layui-input zhushi" value="'+list[key].zhushi+'"></td>';
                str += '<td><input type="number" class="layui-input xueshi" value="'+list[key].xueshi+'"></td>';
                str += '<td><input type="number" class="layui-input renbu" value="'+list[key].renbu+'"></td>';
                str += '<td><input type="number" class="layui-input canshi" value="'+list[key].canshi+'"></td>';
                str += '<td><input type="number" class="layui-input fabu" value="'+list[key].fabu+'"></td>';
                str += '<td><input type="number" class="layui-input quanbu" value="'+list[key].quanbu+'"></td>';
                str += '<td><input type="number" class="layui-input jiang" value="'+list[key].jiang+'"></td>';
                str += '<td><input type="number" class="layui-input yingfee" value="'+list[key].yingfee+'"></td>';
                str += '<td><input type="number" class="layui-input lou" value="'+list[key].lou+'"></td>';
                str += '<td><input type="number" class="layui-input chi" value="'+list[key].chi+'"></td>';
                str += '<td><input type="number" class="layui-input kuang" value="'+list[key].kuang+'"></td>';
                str += '<td><input type="number" class="layui-input qikou" value="'+list[key].qikou+'"></td>';
                str += '<td><input type="number" class="layui-input koufee" value="'+list[key].koufee+'"></td>';
                str += '<td><input type="number" class="layui-input yang" value="'+list[key].yang+'"></td>';
                str += '<td><input type="number" class="layui-input liao" value="'+list[key].liao+'"></td>';
                str += '<td><input type="number" class="layui-input shi" value="'+list[key].shi+'"></td>';
                str += '<td><input type="number" class="layui-input geshui" value="'+list[key].geshui+'"></td>';
                str += '<td><input type="number" class="layui-input zhuankou" value="'+list[key].zhuankou+'"></td>';
                str += '<td><input type="number" class="layui-input gekou" value="'+list[key].gekou+'"></td>';
                str += '<td><input type="number" class="layui-input shanbu" value="'+list[key].shanbu+'"></td>';
                str += '<td><input type="number" class="layui-input yangbu" value="'+list[key].yangbu+'"></td>';
                str += '<td><input type="number" class="layui-input jiaobu" value="'+list[key].jiaobu+'"></td>';
                str += '<td><input type="number" class="layui-input money" value="'+list[key].money+'"></td>';
                str += '<td><input type="text" class="layui-input explain" value="'+list[key].explain+'"></td>';
                str += '</tr>';
                $("#list_list").append(str);
            }
        }
        update_refresh_row_func();
        render_date();
        render_from();
    }

</script>
</body>
</html>
